const request = (url, method = "GET", data = {}) => {
  return new Promise((resolve, reject) => {
    wx.request({
      url: "http://118.24.239.63:3000/api" + url, //仅为示例，并非真实的接口地址
      // method: "POST",
      method: method,
      data: data,
      header: {
        "content-type": "application/json", // 默认值
      },
      success: (res) => {
        resolve(res.data);
      },
    });
  });
};

module.exports = request;
